package Entity;

import java.util.Objects;

public class Officer {
    private String username;
    private String password;
    private String name;

    private String id;
    private String birth;
    private String speciality;
    private String type;
    private String phone;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Officer)) return false;
        Officer officer = (Officer) o;
        return getJurisdiction() == officer.getJurisdiction() && Objects.equals(getUsername(), officer.getUsername()) && Objects.equals(getPassword(), officer.getPassword()) && Objects.equals(getName(), officer.getName()) && Objects.equals(getId(), officer.getId()) && Objects.equals(getBirth(), officer.getBirth()) && Objects.equals(getSpeciality(), officer.getSpeciality()) && Objects.equals(getType(), officer.getType()) && Objects.equals(getPhone(), officer.getPhone());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getUsername(), getPassword(), getName(), getId(), getBirth(), getSpeciality(), getType(), getPhone(), getJurisdiction());
    }

    private int jurisdiction;
    //管理员的权限为2，职工的权限为1

    public Officer(){}

    public Officer(String username, String password, String name,
                    String id, String birth,
                   String speciality, String type, String phone,int jurisdiction) {
        this.username = username;
        this.password = password;
        this.name = name;
        this.jurisdiction = jurisdiction;
        this.id = id;
        this.birth = birth;
        this.speciality = speciality;
        this.type = type;
        this.phone = phone;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBirth() {
        return birth;
    }

    public void setBirth(String birth) {
        this.birth = birth;
    }

    public String getSpeciality() {
        return speciality;
    }

    public void setSpeciality(String speciality) {
        this.speciality = speciality;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setJurisdiction(int jurisdiction) {
        this.jurisdiction = jurisdiction;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUsername() {
        return username;
    }

    public String getPassword() {
        return password;
    }

    public int getJurisdiction() {
        return jurisdiction;
    }
}
